package com.kunsan.compose

import android.util.Log
import androidx.compose.animation.AnimatedContentTransitionScope
import androidx.compose.animation.core.tween
import androidx.compose.runtime.Composable

import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import com.kunsan.compose.compoents.home.MainScreen
import com.kunsan.compose.compoents.login.LoginScreen
import com.kunsan.compose.compoents.room.RoomScreen


@Composable
fun MeetingNavGraph(appState: ElderlyAppState = rememberElderlyAppState()) {

    val navController = appState.navController

    NavHost(navController = navController, startDestination = Screen.Login.route) {
        composable(route = Screen.Login.route) {
            LoginScreen(navigateToHome = { navController.navigate(Screen.Room.route) })
        }

        composable(route = Screen.Home.route) {
            MainScreen(navController)
        }

        composable(route = Screen.Room.route) {
            RoomScreen(navController)
        }

        composable(
            route = MeetingDestinations.ONE_CLICK_LOGIN_ROUTE,
            exitTransition = {
                slideOutOfContainer(
                    AnimatedContentTransitionScope.SlideDirection.Left,
                    animationSpec = tween(700)
                )
            },
            enterTransition = {
                slideIntoContainer(
                    AnimatedContentTransitionScope.SlideDirection.Right,
                    animationSpec = tween(700)
                )
            },

            ) {
            OneClickLogin(navController)
        }

    }
}